package com.demo.ctf;

import java.util.concurrent.CompletableFuture;

public class FutureThenAcceptDemo {
    public static void main(String[] args) throws Exception {

        CompletableFuture<String> orgFuture = CompletableFuture.supplyAsync(
                ()->{
                    return "1.supplyAsync";
                }
        );

        CompletableFuture thenAcceptFuture = orgFuture.thenAccept((a) -> {
            System.out.println(a);
        });

        System.out.println(thenAcceptFuture.get());
    }
}

